package com.my.financial.domain;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="financial_account")
public class FinancialAccount implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 8400022409281486826L;

	@Id
	@GeneratedValue
	private Long id;

	@Column(name="account",columnDefinition="varchar(64)")
	private String account;

	@Column(name="balance",columnDefinition="decimal(11,2)")
	private BigDecimal balance = BigDecimal.ZERO;
	
	@Column(name="account_type",columnDefinition="varchar(16)")
	private String accountType;
	
	@Column(name="summary",columnDefinition="varchar(64)")
	private String summary;
	
	@ManyToOne
	@JoinColumn(name="user_id",columnDefinition="bigint")
	private User user;

	public Long getId() {
		return id;
	}

	public FinancialAccount() {
		
	}
	
	public FinancialAccount(Long id) {
		this.id=id;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getAccountType() {
		return accountType;
	}

	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}
}
